#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 25;

int n, m;
int g[N][N];
int d[N];
int vis[1005];
int get_nxt(int n) {
  rep(i, 1, 1000 - d[n]) {
    bool fail = false;
    rep(j, 1, n) {
      if (vis[i + d[j]]) {
        fail = true;
        break;
      }
    }
    if (!fail) return i;
  }
  return -1;
}
void solve() {
  cin >> n;
  g[1][2] = g[2][1] = 3, g[1][3] = g[3][1] = 4, g[2][3] = g[3][2] = 5;
  vis[3] = vis[4] = vis[5] = 1;
  d[1] = 1, d[2] = 2, d[3] = 3;
  rep(i, 4, n) {
    int now = get_nxt(i - 1);
    rep(j, 1, i - 1) { g[i][j] = g[j][i] = d[j] + now, vis[d[j] + now] = 1; }
    d[i] = g[i][1] - 1;
  }
  rep(i, 1, n) rep(j, 1, n) cout << g[i][j] << " \n"[j == n];
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}